﻿<div class="toolbar" style="margin-top:0; border-top:0;">
    <a href="javascript:void(0);" onclick="window.location='Detail?displaymodel=1'+'&@Html.Raw(ViewData["query"])';return false;"><i class="fa fa-image"></i><label>图形方式</label></a>
    <span class="toolbarsplit">&nbsp;</span>
    <a href="javascript:void(0);" onclick="window.location='Detail?displaymodel=0'+'&@Html.Raw(ViewData["query"])';return false;"><i class="fa fa-reorder"></i><label>列表方式</label></a>
    <span class="toolbarsplit">&nbsp;</span>
    <a href="javascript:void(0);" onclick="new RoadUI.Window().close();"><i class="fa fa-times"></i><label>关闭窗口</label></a>
</div>
@if ("0".Equals(ViewData["displaymodel"].ToString()))
{
    <table id="listtable"></table>
    <script type="text/javascript">
        var rows = @Html.Raw(ViewData["json"]);
        $(function ()
        {
            $("#listtable").jqGrid({
                datatype: "local",
                colNames: ['步骤名称', '发送人', '接收时间', '处理人', '完成时间', '状态', '意见', '备注'],
                colModel: [
                    { name: 'StepName', index: 'StepName' },
                    { name: 'SenderName', index: 'SenderName', align: "left" },
                    { name: 'SenderTime', index: 'SenderTime', align: "left" },
                    { name: 'ReceiveName', index: 'ReceiveName', align: "left" },
                    { name: 'CompletedTime1', index: 'CompletedTime1', align: "left" },
                    { name: 'StatusTitle', index: 'StatusTitle', align: "left" },
                    { name: 'Comment', index: 'Comment', align: "left" },
                    { name: 'Note', index: 'Note', align: "left" }
                ],
                rownumbers: false,//显示序号列
                height: 440,
                rowNum: rows.length,
                width: $(window).width(),
                data: rows
            });
        });
        function showSubFlow(taskid)
        {
            new RoadUI.Window().open({
                title: '查看子流程处理过程',
                url: 'DetailSubFlow?taskid=' + taskid + '', width: 1000, height: 500, openerid: '@ViewData["tabid"]_iframe'
            });
        }
    </script>
}
else
{
    <div style="padding:8px 5px 0 10px;">
        <span style="display:inline-block; height:12px; width:12px; background:#2b9425; border-radius:4px; margin-left:6px; vertical-align:middle;"></span>
        <label style="vertical-align:middle;">已完成步骤</label>
        <span style="display:inline-block; height:12px; width:12px; background:#d41d05; border-radius:4px; margin-left:12px; vertical-align:middle;"></span>
        <label style="vertical-align:middle;">当前步骤</label>
    </div>
    <div id="flowdiv" style="margin:0; padding:0; overflow:auto;"></div>
    <script type="text/javascript">
        var isshowDesign = false;
        var taskJSON = @Html.Raw(ViewData["json1"]);
    </script>
    <script src="~/RoadFlowResources/scripts/flowDesigner/draw-min.js" type="text/javascript"></script>
    <script src="~/RoadFlowResources/scripts/flowDesigner/workflow-show.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function ()
        {
            openFlow1('@ViewData["flowid"]');
        });
    </script>
}